<template>
    <div class="content">
        {{demoStr}}
        <ml-button type="primary">primary</ml-button>
        <router-view></router-view>
    </div>
</template>

<script>
import axios from 'axios';
export default {
    data () {
        return {
            demoStr: ''
        };
    },
    created () {
        axios.get('/api/japi/toh').then((res) => {
            console.log(res);
            this.demoStr = JSON.stringify(res.data);
        });
        // store数据
        console.log(this.$store.getters.demo);
        this.$store.commit('updateDemo', { 1: '哈哈哈' });
        console.log(
            this.$store.getters.demo, '==?'
        );
        // 从modules中拿数据
        console.log(this.$store.getters.getDemoModulesData, 'demoModulesData');
        this.$store.commit('updatedDemoModulesData', '新的');
        console.log(this.$store.getters.getDemoModulesData, 'demoModulesData');
    }
}
</script>

<style scoped>
.content {
    width: 100%;
    background: white;
    height: 1000px;
}
</style>